package main

import (
	"encoding/json"
	"fmt"
	"github.com/kirinlabs/HttpRequest"
)

type responseData struct {
	Data int `json:"data"`
}

func add(a, b int) int {

	req := HttpRequest.NewRequest()
	response, _ := req.Get(fmt.Sprintf("http://127.0.0.1:8000/add?a=%d&b=%d", a, b))
	bytes, _ := response.Body()
	rd := responseData{}
	_ = json.Unmarshal(bytes, &rd)
	return rd.Data
}

func main() {

	fmt.Println(add(3,5))
}
